package com.qa.dom.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.qa.dom.dto.HomePageDto;
import com.qa.dom.entity.Returnplay;
import com.qa.dom.entity.Usertable;
import com.qa.dom.service.IReturnplayService;
import com.qa.dom.service.IUsertableService;
import com.qa.dom.util.JsonResult;
import com.qa.dom.util.baseAction;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 回访模块
 * @author z77z
 * @since 2017-12-25
 */
@Controller
@Api(description = "播放控制器页面",tags = {"返回控制器数据"})
@RequestMapping("/returnplay")
    public class ReturnPlayController extends baseAction {
        @Resource
        private IReturnplayService returnplayService;


        /**
         * 我的回放
         * 分页
         * @param page
         * @param limit
         * @param usertable
         * @return
         */

        @PostMapping("/queryReturnPlayPage")
        @ApiOperation(value = "获取页面",notes = "我的消息",httpMethod = "POST")
        @ResponseBody
        public JsonResult queryReturnPlayPage(@ApiParam("当前页") @RequestParam("page") Integer page, @ApiParam("每页大小") @RequestParam("limit") Integer limit){
            Usertable usertable  = getCurrentUser();
            Page<Returnplay> page1 = new Page<>(page, limit);
            System.out.println("1M<<<"+page1);
            Page<Returnplay> s = returnplayService.queryReturnPlayPage(page1,usertable);
            return renderSuccess(0,"访问成功", s.getTotal(), s.getRecords());
        }


}





